//
// Created by yan on 7/7/17.
//

#include "uploadsys/uploadBase.h"

uploadBase::uploadBase(std::string name) : bSysNode(name) {

}

int uploadBase::addUploadDevice(std::string deviceName) {
    uploadDev = (bUploadMod *)getIstance(deviceName);
    if(uploadDev == NULL)
        return -1;
//    if(uploadDev->setMode(getIstance("uploadcfg")))
//        return -1;

    return 0;
}

ssize_t uploadBase::sendData(void *buf, size_t count) {
    return uploadDev->sendData(buf,count);
}

ssize_t uploadBase::recvData(void *buf, size_t count) {
    return uploadDev->recvData(buf,count);
}

int uploadBase::connect() {
    return uploadDev->connect();
}
